using Microsoft.AspNetCore.Mvc;
using _RobotInspection.DTO;
using _RobotInspection.Models;
using System.Collections.Generic;
using System.Threading.Tasks;
using _RobotInspection.Services;

namespace _RobotInspection.Interfaces
{
    /// <summary>
    /// 点检计划服务接口
    /// </summary>
    public interface IInspectionPlanService
    {
        /// <summary>
        /// 获取所有设备及其点检项（用于创建计划时选择）
        /// </summary>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<List<EquipmentWithItemsDto>>>> GetEquipmentWithItemsAsync();

        /// <summary>
        /// 创建点检计划
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<long>>> CreateInspectionPlanAsync(CreateInspectionPlanDto dto);

        /// <summary>
        /// 获取点检计划列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<PagedResult<InspectionPlanResponseDto>>>> GetInspectionPlansAsync(InspectionPlanQueryDto query);

        /// <summary>
        /// 根据计划ID获取计划详情
        /// </summary>
        /// <param name="planId"></param>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<InspectionPlanResponseDto>>> GetInspectionPlanByIdAsync(long planId);

        /// <summary>
        /// 启用/禁用点检计划
        /// </summary>
        /// <param name="planId"></param>
        /// <param name="isActive"></param>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<bool>>> UpdatePlanStatusAsync(long planId, byte isActive);

        /// <summary>
        /// 获取所有公司及其机组（用于创建计划时选择）
        /// </summary>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<List<EquipmentHierarchyDto>>>> GetCompanyWithCrewAsync();

        /// <summary>
        /// 根据id获取指定设备的点检项
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<object>>> GetInspectionItems(long id);

        /// <summary>
        /// 根据机组查询点检计划列表
        /// </summary>
        /// <param name="unit">机组名称</param>
        /// <param name="planType">点检周期类型（可选）</param>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<List<InspectionPlanByUnitDto>>>> GetInspectionPlansByUnitAsync(string unit, byte? planType = null);

        /// <summary>
        /// 分页查询点检计划
        /// </summary>
        /// <param name="queryDto">查询条件</param>
        /// <returns></returns>
        Task<ActionResult<ApiResponse<InspectionPlanPagedResultDto>>> GetInspectionPlansPagedAsync(InspectionPlanPagedQueryDto queryDto);
    }
}